
#ifndef _USERRECORD_H_20111127
#define _USERRECORD_H_20111127

#include <string>
#include "Record.h"

namespace AirlineRes
{

/// Class to store and operate upon the data that comprises a system user.
class UserRecord : public Record
{
public:
  UserRecord(){};
  ~UserRecord(){};

  /// Construct record initialised with field values.
  UserRecord( std::string const& _username, std::string const& _password, bool _isAdmin);

  virtual RecordIOResult LoadRecord( std::istream& _stream );
  virtual RecordIOResult WriteRecord( std::ostream& _stream ) const;

  // Getters
  inline std::string GetUsername() const { return m_username; };
  inline std::string GetPassword() const { return m_password; };
  inline bool        GetIsAdmin()  const { return m_isAdmin;  };

  // Setters
  inline void SetUsername( std::string _username ) { m_username = _username; };
  inline void SetPassword( std::string _password ) { m_password = _password; };
  inline void SetIsAdmin( bool _isAdmin )          { m_isAdmin  = _isAdmin;  };

private:
  std::string m_username;
  std::string m_password;
  bool m_isAdmin;
};

} // namespace AirlineRes

#endif _USERRECORD_H_20111127
